package com.youlu.campus.admin.learning;

import com.youlu.campus.admin.leads.dto.SalesLeadsRequst;
import com.youlu.campus.entity.DailyLearning;
import com.youlu.campus.entity.VO.req.DailyLearningQueryVO;
import com.youlu.campus.service.learning.DailyLearningService;
import com.yuelin.infrastructure.quantum.common.QResult;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@RestController
public class DailyLearningController {
    @Autowired
    private DailyLearningService dailyLearningService;

    @PostMapping("/daily-learning/list")
    public QResult listPages(@RequestBody @Valid DailyLearningQueryVO req) {
        return QResult.success(dailyLearningService.list(req));

    }

    @PostMapping("/daily-learning/create")
    public QResult create(@RequestBody @Valid DailyLearning req) {
        return QResult.success(dailyLearningService.create(req));

    }

    @PostMapping("/daily-learning/update")
    public QResult update(@RequestBody @Valid DailyLearning req) {
        return QResult.success(dailyLearningService.update(req));

    }

    @GetMapping("/daily-learning/delete")
    public QResult delete(@RequestParam("id") String id) {
        return QResult.success(dailyLearningService.delete(id));

    }
}
